package com.xzh.wms.controller;

import com.xzh.wms.entity.IoItem;
import com.xzh.wms.entity.IoItemQuery;
import com.xzh.wms.entity.IoMaster;
import com.xzh.wms.entity.IoMasterQuery;
import com.xzh.wms.service.IoItemService;
import com.xzh.wms.service.IoMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 采购单头;(206_po_master)控制层
* @author : heimi
* @date : 2024-11-25
*/
@RestController
@RequestMapping("/api/io")
public class IoController {
   @Autowired
   private IoMasterService ioMasterService;

    @Autowired
    private IoItemService ioItemService;

   /**
    * 查询接口
    */
    @GetMapping
    public List<IoMaster> select(IoMasterQuery query){
       return ioMasterService.select(query);
   }
    @GetMapping("/item")
    public List<IoItem> selectItem(IoItemQuery query){
        return ioItemService.select(query);
    }

   @PostMapping
   public Integer insert(@RequestBody IoMaster product){
      return ioMasterService.insert(product);
   }

   @PutMapping
   public Integer update(@RequestBody IoMaster product){
       return ioMasterService.update(product);
   }

   @DeleteMapping
   public Integer delete(Integer id){
       return ioMasterService.delete(id);
   }
}